home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / clipper / rshpcx13.zip / SAMPLE.PRG < prev   
Text File  |  1993-06-18  |  1KB  |  45 lines

  1. *----------------------------------------------------------------------
  2. * SAMPLE.PRG :
  3. * Sample program to demonstrate the use of R_ShowPCX ()
  4. *----------------------------------------------------------------------
  5. * The program displays a slideshow of all the PCX-files in the current
  6. * directory.
  7. *----------------------------------------------------------------------
  8. * (c) 1993  Rolf van Gelder, EINDHOVEN
  9. *----------------------------------------------------------------------
  10. * Note: Compile with the /N switch
  11. *       Link with the R_ShowPCX() library
  12. *----------------------------------------------------------------------
  13. FUNCTION SlideShow
  14.  
  15. LOCAL    aPCX   := Directory ( '*.PCX' )
  16. LOCAL    nFiles := Len ( aPCX )
  17. LOCAL    i
  18. LOCAL    nRetCode
  19.  
  20. IF nFiles < 1
  21.  
  22.    Alert ( 'No PCX-files found in current directory ...' )
  23.  
  24. ELSE
  25.  
  26.    FOR i := 1 TO nFiles
  27.       *-- Loop to process all the PCX-files found
  28.  
  29.       *-- Show next PCX-file during 3 seconds
  30.       nRetCode := R_ShowPCX ( aPCX [i,1], { || inkey ( 3 ) } )
  31.  
  32.       IF nRetCode != 0
  33.          *-- Oops, error detected !
  34.          Clear
  35.          Alert ( 'Error displaying '+aPCX [i,1]+;
  36.             ', Errorcode: '+LTrim ( Str ( nRetCode ) ) )
  37.       ENDIF
  38.  
  39.    NEXT
  40.  
  41. ENDIF
  42.  
  43. RETURN nil
  44. *----------------------------------------------------------------------
  45.